package com.huayi.website.service.impl;

import com.huayi.website.entity.EnumLanguage;
import com.huayi.website.entity.PageContentEntity;
import com.huayi.website.repository.PageContentRepository;
import com.huayi.website.service.PageContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PageContentServiceImpl implements PageContentService {
    @Autowired
    private PageContentRepository repository;

    @Override
    public List<PageContentEntity> getAllList( Integer columnId) {
        return repository.getAllList(columnId);
    }

    @Override
    public PageContentEntity getById(Integer pageContentId) {
        return repository.getById(pageContentId);
    }

    @Override
    public PageContentEntity getByPageIdAndLanguage(Integer pageId, EnumLanguage language) {
        return repository.getByPageIdAndLanguage(pageId,language);
    }

    @Override
    public Integer editPageContent(Integer pageContentId, String title, String image,String image1, String content, Integer sort, Integer pageId,Integer language) {
        return repository.editPageContent(pageContentId,title,image,image1,content,sort,pageId,language);
    }

    @Override
    public void delete(Integer pageContentId) {
        repository.delete(pageContentId);
    }
}
